import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    {
      path: '/home',
      name: 'home', 
      component: HomeView,
      children:[
        {//首页
          path: 'dashboard',
          name: 'dashboard',
          meta:{
            title:'首页'
          },
          component: () => import('../views/Dashboard.vue')
        },
         {//会员
          path: 'member',
          name: 'member',
           meta:{
            title:'会员'
          },
          component: () => import('../views/member/Member.vue')
        },
         {//会员卡
          path: 'memberCard',
          name: 'memberCard',
           meta:{
            title:'会员卡'
          },
          component: () => import('../views/member/MemberCard.vue')
        },
         {//会员绑定
          path: 'memberBind',
          name: 'memberBind',
           meta:{
            title:'会员绑定'
          },
          component: () => import('../views/member/MemberBind.vue')
        },
         {//团课
          path: 'courseList',
          name: 'courseList',
           meta:{
            title:'团课课程'
          },
          component: () => import('../views/course/CourseList.vue')
        },
         {//团课课表
          path: 'courseSchedule',
          name: 'courseSchedule',
           meta:{
            title:'团课课程报表'
          },
          component: () => import('../views/course/CourseSchedule.vue')
        },
         {//团课预约设置
          path: 'courseReservation',
          name: 'courseReservation',
           meta:{
            title:'团课预约设置'
          },
          component: () => import('../views/course/CourseReservation.vue')
        },
         {//教师管理
          path: 'teacherList',
          name: 'teacherList',
          meta:{
            title:'教师管理'
          },
          component: () => import('../views/teacher/TeacherList.vue')
        },
        { //老师明细
          path: 'teacherDetail/:id',
          meta: {
            title: '老师明细'
          },
          name: 'teacherDetail',
          component: () => import('../views/teacher/TeacherDetail.vue')
        },
        {//会员卡统计
          path: 'cardListStat',
          name: 'cardListStat',
          meta:{
            title:'会员卡统计'
          },
          component: () => import('../views/statistics/CardListStat.vue')
        },
         {//收费统计
          path: 'cardCostStat',
          name: 'cardCostStat',
           meta:{
            title:'收费统计'
          },
          component: () => import('../views/statistics/CardCostStat.vue')
        },
         {//消课统计
          path: 'classCostStat',
          name: 'classCostStat',
           meta:{
            title:'消课统计'
          },
          component: () => import('../views/statistics/ClassCostStat.vue')
        },
         {//总课次统计
          path: 'classHourStat',
          name: 'classHourStat',
           meta:{
            title:'总课次统计'
          },
          component: () => import('../views/statistics/ClassHourStat.vue')
        },
         {//新增与流失统计
          path: 'memberNumStat',
          name: 'memberNumStat',
           meta:{
            title:'新增与流失统计'
          },
          component: () => import('../views/statistics/MemberNumStat.vue')
        },
         {//微信设置
          path: 'weChat',
          name: 'weChat',
           meta:{
            title:'微信设置'
          },
          component: () => import('../views/other/WeChat.vue')
        },
         {//应用中心
          path: 'appStore',
          name: 'appStore',
            meta:{
            title:'应用中心'
          },
          component: () => import('../views/other/AppStore.vue')
        },

        {//修改密码
          path: '/modifyPwd',
          name: 'modifyPwd',
            meta:{
            title:'修改密码'
          },
          component: () => import('../views/profile/ModifyPwd.vue')
        },
        {//跟人资料
          path: '/profile',
          name: 'profile',
            meta:{
            title:'个人资料'
          },
          component: () => import('../views/profile/Profile.vue')
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/RegisterView.vue')
    }
  ]
})

export default router
